package org.example.minebackend.service.impl;

import org.example.minebackend.mapper.LoginMapper;
import org.example.minebackend.pojo.LoginUser;
import org.example.minebackend.pojo.User;
import org.example.minebackend.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class LoginServiceImpl implements LoginService {
    @Autowired
    LoginMapper loginMapper;
    public User userLogin(LoginUser loginUser) {
        String username = loginUser.getUsername();
        String password = loginUser.getPassword();
        User user = loginMapper.userLogin(username, password);
        if (user == null) {
            return null;
        }
        return user;
    }
}
